import request from '@/config/axios'

export interface AccountVO {
  id: number
  avatar: string
  background: string
  name: string
  identity: string
  intro: string
  age: string
  region: string
  follow: number
  fans: number
  like: number
  worksCount: number
  latestUpdateTime: Date
  remark: string
  jsonSource: string
}

// 查询账号信息列表
export const getAccountPage = async (params) => {
  return await request.get({ url: `/beat/account/page`, params })
}

// 查询账号信息详情
export const getAccount = async (id: number) => {
  return await request.get({ url: `/beat/account/get?id=` + id })
}

// 新增账号信息
export const createAccount = async (data: AccountVO) => {
  return await request.post({ url: `/beat/account/create`, data })
}

// 修改账号信息
export const updateAccount = async (data: AccountVO) => {
  return await request.put({ url: `/beat/account/update`, data })
}

// 删除账号信息
export const deleteAccount = async (id: number) => {
  return await request.delete({ url: `/beat/account/delete?id=` + id })
}

// 导出账号信息 Excel
export const exportAccount = async (params) => {
  return await request.download({ url: `/beat/account/export-excel`, params })
}
